﻿<Window x:Class="PrintServerTables.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="501" Width="994">
    <Grid >
        <Grid.Resources>
            <DataTemplate DataType="SERVER">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{ Binding XPath=Name }" />
                    <TextBlock Text="{ Binding XPath=PrivateIp }" />
                    <TextBlock Text="{ Binding XPath=PublicIp }" />
                    <TextBlock Text="{ Binding XPath=Web}" />
                    <TextBlock Text="{ Binding XPath=Port}" />
                </StackPanel>
            </DataTemplate>
            <Style TargetType="DataGridColumnHeader" x:Key="ColumnHeaderStyle">
                <Setter Property="FontSize" Value="12"/>
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="HorizontalContentAlignment"  Value="Center"/>
                <Setter Property="Foreground"  Value="DarkBlue"/>
            </Style>
        </Grid.Resources>
        <TextBlock Height="24" HorizontalAlignment="Left" Margin="12,20,0,0" Name="tbTitle" Text="Available print servers" VerticalAlignment="Top" Width="721" TextAlignment="Center" FontSize="16" Foreground="DarkBlue" FontWeight="Bold" />
        <Border BorderBrush="DarkBlue" BorderThickness="3" Height="34" HorizontalAlignment="Left" Margin="44,14,0,0" Name="border1" VerticalAlignment="Top" Width="885" />
        <DataGrid AutoGenerateColumns="False" Height="321" HorizontalAlignment="Left" 
                  Margin="44,46,0,0" Name="grdServers" VerticalAlignment="Top" Width="885"
                  ColumnHeaderStyle="{ StaticResource ColumnHeaderStyle }"
                  ItemsSource="{Binding}" BorderThickness="3" BorderBrush="DarkBlue" FontWeight="Bold" 
                  CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False" 
                  CanUserSortColumns="False" 
                  HorizontalContentAlignment="Stretch" RowHeaderWidth="0" Background="White" CanUserAddRows="False" CanUserDeleteRows="False" SelectionMode="Extended" HorizontalScrollBarVisibility="Hidden" BeginningEdit="grdServers_BeginningEdit" IsSynchronizedWithCurrentItem="True" MouseDoubleClick="grdServers_MouseDoubleClick">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding name }" Width="183" Foreground="DarkBlue" FontWeight="Bold" Header="Server Name" IsReadOnly="True" />
                <DataGridTextColumn Binding="{Binding location }" Width="182" Foreground="DarkBlue" FontWeight="Bold" Header="Location" IsReadOnly="True" />
                <DataGridTextColumn Header="Intranet Ip" Binding="{Binding privateIp }" Width="120" CanUserResize="False" Foreground="DarkBlue" FontWeight="SemiBold" IsReadOnly="True" />
                <DataGridTextColumn Header="Public Ip" Binding="{Binding publicIp }" Width="120" FontWeight="SemiBold" Foreground="DarkBlue" IsReadOnly="True" />
                <DataGridTextColumn Header="Web Address" Binding="{Binding web }" Width="200" Foreground="DarkBlue" FontWeight="SemiBold" IsReadOnly="True" />
                <DataGridTextColumn Header="Port" Binding="{Binding port }" Width="75" Foreground="DarkBlue" FontWeight="SemiBold" IsReadOnly="True" />
            </DataGrid.Columns>
        </DataGrid>
        <Button Height="41" HorizontalAlignment="Left" Margin="44,395,0,0" Name="btnAdd" VerticalAlignment="Top" Width="119" HorizontalContentAlignment="Left" Background="White" Click="btnAdd_Click">
            <StackPanel Orientation="Horizontal" Width="111">
                <Image Height="32" HorizontalAlignment="Left" Stretch="Fill" VerticalAlignment="Top" Width="32" Source="/PrintServerTables;component/Resources/add2.png" />            
                <TextBlock Height="31" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Foreground="DarkBlue" FontWeight="Bold" FontSize="12" Width="60" TextAlignment="Center" FontStretch="Normal">
                    Add<LineBreak />
                    a server
                </TextBlock>
            </StackPanel>
        </Button>
        <Button Height="41" HorizontalAlignment="Left" Margin="199,395,0,0" Name="btnDelete" VerticalAlignment="Top" Width="119" HorizontalContentAlignment="Left" Background="White" Click="btnDelete_Click">
            <StackPanel Orientation="Horizontal" Width="111">
                <Image Height="32" HorizontalAlignment="Left" Stretch="Fill" VerticalAlignment="Top" Width="32" Source="/PrintServerTables;component/Resources/minus.jpg" />
                <TextBlock Height="31" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Foreground="DarkBlue" FontWeight="Bold" FontSize="12" Width="70" TextAlignment="Center" FontStretch="Normal">
                    Delete<LineBreak />
                    a server
                </TextBlock>
            </StackPanel>
        </Button>
        <Button Height="41" HorizontalAlignment="Right" Margin="0,395,220,0" Name="btnSave" VerticalAlignment="Top" Width="98" HorizontalContentAlignment="Left" Background="White" Click="btnSave_Click">
            <StackPanel Orientation="Horizontal" Width="95">
                <Image Height="32" HorizontalAlignment="Left" Stretch="Fill" VerticalAlignment="Top" Width="32" Source="/PrintServerTables;component/Resources/disk_blue.png" />
                <TextBlock Height="20" HorizontalAlignment="Left" Margin="10,8,0,0" VerticalAlignment="Top" Foreground="DarkBlue" FontWeight="Bold" FontSize="12" Width="45" TextAlignment="Center" FontStretch="Normal" Text="Save"></TextBlock>
            </StackPanel>
        </Button>
        <Button Height="41" HorizontalAlignment="Right" Margin="0,395,43,0" Name="btnClose" VerticalAlignment="Top" Width="119" HorizontalContentAlignment="Left" Background="White" Click="btnClose_Click">
            <StackPanel Orientation="Horizontal" Width="111">
                <Image Height="32" HorizontalAlignment="Left" Stretch="Fill" VerticalAlignment="Top" Width="32" Source="/PrintServerTables;component/Resources/door2.png" />
                <TextBlock Height="31" HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Top" Foreground="DarkBlue" FontWeight="Bold" FontSize="12" Width="69" TextAlignment="Center" FontStretch="Normal">
                    Close<LineBreak />
                    and exit
                </TextBlock>
            </StackPanel>
        </Button>

    </Grid>
</Window>
